/**
 * 项目名称:
 *
 * @Author: 夏国倩
 * @Date: 2023/9/12 9:58
 * @Copyright
 */
package itSystemCase2;
//客车类
public class PassengerCar extends Car{
    private int seatCount; //座位数

    public PassengerCar(){

    }

    public PassengerCar(String licenseplate, String brand, int dailyrent, int seatCount) {
        super(licenseplate,brand,dailyrent);
        this.seatCount = seatCount;
    }

    public int getSeatCount() {
        return seatCount;
    }

    public void setSeatCount(int seatCount) {
        this.seatCount = seatCount;
    }

    /*
    * 重写计算租金
    * */
    @Override
    public float calRent(int days) {
        float price=this.getDailyrent()*days;
        if (days>=3 && days<7){
            price *=0.9f;
        }else if (days>=7 && days<30){
            price *=0.8f;
        }else if (days>=150){
            price *=0.6f;
        }
        return price;
    }
}
